package cn.edu.hqu.javaee.Controller;


import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.edu.hqu.javaee.entity.Student;
//import org.springframework.web.bind.annotation.RestController;解析成数据

@Controller
/**
 * 如果说在Controller类上加RestController注解代表该controller当中的所有方法都返回Json串
 */

public class UserController {

   
    
    @RequestMapping("/home/user")
    
    public String user(Model model){
    	Student stu=new Student();
    	stu.setName("nick");
    	stu.setId("1825122012");
    	stu.setGrade("2018");
    	stu.setMajor("软件工程software engineering");
    	stu.setDepartment("计算机科学与技术学院");
        model.addAttribute("stu", stu);
    	
    	
        return "user"; 
    }
    
    

}